
package io.github.eiot.ocpp.schema.v2_1;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Size;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "receiptUrl",
    "receiptId",
    "customData"
})
public class NotifySettlementResponse {

    /**
     * The receipt URL if receipt generated by CSMS. The Charging Station can QR encode it and show it to the EV Driver.
     * 
     * 
     * 
     */
    @JsonProperty("receiptUrl")
    @JsonPropertyDescription("The receipt URL if receipt generated by CSMS. The Charging Station can QR encode it and show it to the EV Driver.\r\n\r\n")
    @Size(max = 2000)
    private String receiptUrl;
    /**
     * The receipt id if the receipt is generated by CSMS.
     * 
     * 
     * 
     */
    @JsonProperty("receiptId")
    @JsonPropertyDescription("The receipt id if the receipt is generated by CSMS.\r\n\r\n")
    @Size(max = 50)
    private String receiptId;
    /**
     * This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.
     * 
     */
    @JsonProperty("customData")
    @JsonPropertyDescription("This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.")
    @Valid
    private CustomData customData;

    /**
     * The receipt URL if receipt generated by CSMS. The Charging Station can QR encode it and show it to the EV Driver.
     * 
     * 
     * 
     */
    @JsonProperty("receiptUrl")
    public String getReceiptUrl() {
        return receiptUrl;
    }

    /**
     * The receipt URL if receipt generated by CSMS. The Charging Station can QR encode it and show it to the EV Driver.
     * 
     * 
     * 
     */
    @JsonProperty("receiptUrl")
    public void setReceiptUrl(String receiptUrl) {
        this.receiptUrl = receiptUrl;
    }

    public NotifySettlementResponse withReceiptUrl(String receiptUrl) {
        this.receiptUrl = receiptUrl;
        return this;
    }

    /**
     * The receipt id if the receipt is generated by CSMS.
     * 
     * 
     * 
     */
    @JsonProperty("receiptId")
    public String getReceiptId() {
        return receiptId;
    }

    /**
     * The receipt id if the receipt is generated by CSMS.
     * 
     * 
     * 
     */
    @JsonProperty("receiptId")
    public void setReceiptId(String receiptId) {
        this.receiptId = receiptId;
    }

    public NotifySettlementResponse withReceiptId(String receiptId) {
        this.receiptId = receiptId;
        return this;
    }

    /**
     * This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.
     * 
     */
    @JsonProperty("customData")
    public CustomData getCustomData() {
        return customData;
    }

    /**
     * This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.
     * 
     */
    @JsonProperty("customData")
    public void setCustomData(CustomData customData) {
        this.customData = customData;
    }

    public NotifySettlementResponse withCustomData(CustomData customData) {
        this.customData = customData;
        return this;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(NotifySettlementResponse.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
        sb.append("receiptUrl");
        sb.append('=');
        sb.append(((this.receiptUrl == null)?"<null>":this.receiptUrl));
        sb.append(',');
        sb.append("receiptId");
        sb.append('=');
        sb.append(((this.receiptId == null)?"<null>":this.receiptId));
        sb.append(',');
        sb.append("customData");
        sb.append('=');
        sb.append(((this.customData == null)?"<null>":this.customData));
        sb.append(',');
        if (sb.charAt((sb.length()- 1)) == ',') {
            sb.setCharAt((sb.length()- 1), ']');
        } else {
            sb.append(']');
        }
        return sb.toString();
    }

    @Override
    public int hashCode() {
        int result = 1;
        result = ((result* 31)+((this.customData == null)? 0 :this.customData.hashCode()));
        result = ((result* 31)+((this.receiptUrl == null)? 0 :this.receiptUrl.hashCode()));
        result = ((result* 31)+((this.receiptId == null)? 0 :this.receiptId.hashCode()));
        return result;
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if ((other instanceof NotifySettlementResponse) == false) {
            return false;
        }
        NotifySettlementResponse rhs = ((NotifySettlementResponse) other);
        return ((((this.customData == rhs.customData)||((this.customData!= null)&&this.customData.equals(rhs.customData)))&&((this.receiptUrl == rhs.receiptUrl)||((this.receiptUrl!= null)&&this.receiptUrl.equals(rhs.receiptUrl))))&&((this.receiptId == rhs.receiptId)||((this.receiptId!= null)&&this.receiptId.equals(rhs.receiptId))));
    }

}
